const Router = require("koa-router");

const { auth } = require("../middleware/auth.middleware");
const {
  sendQuestion,
  getQuestions,
  getQuestionsDetail,
  collectQuestion,
  noCollectQuestion,
  getAllCollectQuestion,
  getHostQuestions
} = require("../controller/question.controller");
const {} = require("../middleware/question.middleware");
const router = new Router({ prefix: "/questions" });
// 新建题目
router.post("/sendQuestion", auth, sendQuestion);
// 获取分页题目
router.get("/getQuestions", getQuestions);
// 获取题目详情
router.get("/getQuestionsDetail", auth, getQuestionsDetail);
// 收藏
router.post("/collectQuestion", auth, collectQuestion);
// 取消收藏
router.post("/noCollectQuestion", auth, noCollectQuestion);
// 获得某个用户的所有收藏
router.post("/getAllCollectQuestion", auth, getAllCollectQuestion);
// 获得热门题目 根据浏览量排序
router.post('/getHostQuestions',getHostQuestions)
module.exports = router;
